Field of the Invention
The present invention relates to a computer-implemented method for real-time testing of a control unit with a simulator, wherein the simulator includes a simulator I/O interface, wherein the control unit includes a control unit I/O interface, and wherein the control unit and the simulator are connected to one another through their I/O interfaces via at least one data channel, and the control unit transmits converter control data to the simulator through the data channel, the simulator calculates a load current and a load voltage as electrical load state variables via the converter control data and via an electrical load model that does not take into account current discontinuities caused by the converter and transmits at least a portion of the load state variables to the control unit.
Description of the Background Art
Methods for control unit testing have long been known, and are used in many areas of control unit development when the control unit or the algorithms implemented on the control unit are to be tested for proper functionality without the need to place the control unit in its “real” operating environment.
In an exemplary case the control unit generates converter control data that are used to appropriately drive power switches of a converter, which are typically implemented by semiconductor switching elements (IGBT, IGCT, etc.). Converters are used to convert energy between an energy source and an electrical load. The converter can convert between DC and AC voltage, or between DC and AC current, by driving the power switches of the converter. If the energy source provides a DC voltage and drives a load with AC voltage via the converter, then the converter operates as an inverter; in the converse case—the energy source provides an AC voltage and uses it to drive a load with DC voltage via the converter—the converter operates as a rectifier.
Independently of the operating mode of the converter, the simulator in the application case examined here serves to recreate not only the converter with its power switches but also the electrical load powered by the converter. Accordingly, the control unit, which is physically present, is operated together with the simulator as “hardware-in-the-loop”, wherein the simulator, aided by an electrical load model that mathematically simulates the electrical load and using the converter control data coming from the control unit, calculates the electrical state variables and if applicable transmits them back to the control unit. The hardware-in-the-loop test of the control unit implemented in this way permits reproducible, safe, automated, and thus ultimately economical test runs under laboratory conditions.
In the majority of application cases arising in practice, the electrical load has an inductive component that prevents a discontinuous change in the load current. So that the load current can nonetheless continue to flow in the same direction as beforehand after an actuation of the power switches of the inverter and the voltage reversal at the electrical load that may be associated therewith, diodes are usually connected to the power switches of the converter in an anti-parallel manner, which diodes can continue to carry the current until the current becomes zero; the diodes then block.
For the case where the load current becomes zero when all power switches of the converter supplying the load are blocking, the current remains at zero until one of the supplying power switches is switched back into conductivity, which is to say a connection is established to the supplying negative or positive supply voltage. The persistence of the current at zero is generally referred to as a current discontinuity, and the operating mode is called discontinuous mode. Current discontinuities arise, for example, in the case of brushless DC motors and in the operating modes of inverters that deviate from complementary driving of the power switches. Moreover, current discontinuities occur in special cases, as for example short-circuit braking of permanently excited synchronous machines, but also in the event of electrical faults.
Even though the causes of the current discontinuity are immediately comprehensible in electrical engineering terms, and the resulting current curves are in principle relatively simple to calculate even when taking the current discontinuity into account, the calculation of state variables in converter-fed electrical loads under real-time conditions constitutes a considerable problem. The difficulty in the calculation of load state variables in discontinuous mode is that when current discontinuities arise, the load model undergoes a structural change, and then the load current can no longer be calculated using the load description according to the equations employed with free current paths. The numerical handling of such structural changes is not a fundamental problem, but frequently cannot be accomplished under real-time requirements.
If there is no need for the load model to be calculated in real time—one second of simulation time corresponds to one second of real time—which is to say that an essentially arbitrary amount of time is available, then it is possible, for example, to use calculation methods with a variable step size and zero-crossing detection to detect the internal switching times of the converter, hence for example the current discontinuity resulting from the onset of blocking by the diodes, with high accuracy, so that the load model can be calculated with high accuracy even when the current discontinuity is taken into account. Even though numerical methods with variable step size and numerical methods for zero-point detection, which for their part often operate iteratively, make it possible to maintain a predefined error limit, the time required for a calculation step can be subject to considerable variation, with the result that real-time conditions cannot be maintained with certainty.
Alternatively, if the numerical methods with constant step size that have proven their worth for real time simulations are used, then the calculation step size must be chosen very small in order to detect current zero-crossings with only a slight delay so that the inaccuracies caused by delayed accounting for internal switching events remain as small as possible. The ratio of the switching period duration of the converter to the step size of the real-time calculation should be in the region of >100, since otherwise internal switching events that result in a current discontinuity are only detected with a time resolution with a time resolution worse than 1% relative to the switching period duration of the converter. It is immediately evident that such oversampling under real-time conditions requires very rapid calculation of the load model within a simulation step on the simulator. At present, using conventional processors in simulators this can be implemented at most for very low switching frequencies in the range of 1 KHz, for example, (which would nonetheless mean a calculation step size of only 10 μs for the proposed hundredfold oversampling).
For the aforementioned reasons, so-called average-value models are frequently used for calculating the load state variables of an electrical load driven by a converter; in these models, the ability to account for and resolve internal switching processes within the switching period of the converter is intentionally foregone, and the behavior of the load state variables within a switching period of the converter is not of interest. In average-value models, the instantaneous value of the load state variable is not calculated at the sampling time; instead, what is calculated is the average value of the load state variable over the previous calculation interval. If the calculation period of the load model matches the switching period of the converter, the average-value model represents the average values of the load currents and voltages over the last switching period. One disadvantage of this method for calculating load state variables via an electrical model that does not take into account current discontinuities caused by the converter is an unavoidable calculation error in the event of current discontinuity. For example, such a calculation error can manifest itself as non-decaying residuals or as continuous oscillations about the current zero point, even when the actual load current actually would of necessity have come to a complete stop.